import DynamicData from './DynamicData'
import { watch, ref } from 'vue'
import { watchLangChange } from '@/utils/i18n'
export const dynaamicData = ref([])
dynaamicData.value = DynamicData()
watchLangChange(() => {
  dynaamicData.value = DynamicData()
  getCheckList()
})
export const checkList = ref([])
export const getCheckList = () => {
  checkList.value = dynaamicData.value.map((it) => it.label)
}
getCheckList()
export const tabColumn = ref([])
export const getDynamicTabl = () => {
  const tabFilter = dynaamicData.value.filter((it) =>
    checkList.value.includes(it.label)
  )

  tabColumn.value = [...tabFilter]
}
watch(
  checkList,
  () => {
    tabColumn.value = ref([])
    getDynamicTabl()
  },
  {
    immediate: true
  }
)
